package com.wmh.baseservice.skd.mapper;

import com.wmh.baseservice.skd.pojo.SkdShoppingCart;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
* @author CH
* @description 针对表【skd_shopping_cart】的数据库操作Mapper
* @createDate 2024-01-15 14:54:58
* @Entity com.wmh.baseservice.skd.pojo.SkdShoppingCart
*/
public interface SkdShoppingCartMapper extends BaseMapper<SkdShoppingCart> {

    @Select("SELECT id FROM skd_shopping_cart WHERE user_id = #{usId} AND off_shelves = 1")
    List<Long> getInvalidGoodsIds(Long usId);
    @Update("UPDATE skd_shopping_cart SET off_shelves = 1 WHERE group_buying_activity_id = #{groupBuyingActivityId}")
    boolean offShelvesShoppingCart(Long groupBuyingActivityId);
    @Update("UPDATE skd_shopping_cart SET off_shelves = 0 WHERE group_buying_activity_id = #{groupBuyingActivityId}")
    boolean onShelvesShoppingCart(Long groupBuyingActivityId);
}




